package com.wkbb.common.constants;

/**
 * 缓存key前缀定义，防止各个子系统或模块key冲突
 *
 * @author wuxq
 */
public final class RedisKeyConstant {

    /**
     * 教育社区
     */
    public static final String WKBB_EDUCATION_COMMUNITY_DYNAMIC = "wkbb:community:dynamic:";

    /**
     * 家校通IM
     */
    public static final String WKBB_EDUCATION_COMMUNITY_IM = "wkbb:community:im:";

    /**
     * 家校通IM,删除通讯录后保留删除记录。用来防止重复操作删除动作。
     */
    public static final String WKBB_EDUCATION_COMMUNITY_IM_DEL_USERS = "wkbb:community:im:del:";
    /**
     * 家校通IM,删除通讯录后保留删除记录。用来防止重复操作删除动作。短时间不允许再删除缓存
     */
    public static final String WKBB_EDUCATION_COMMUNITY_IM_DEL_NOT_ALLOW = "wkbb:community:im:del:notallow:";

    /**
     * 订单
     */
    public static final String WKBB_EDUCATION_COMMUNITY_ORDER = "wkbb:community:order:";

    /**
     * 订单审核防重复
     */
    public static final String WKBB_ORDER_AUDIT_ORDERIDS_MD5 = "wkbb:order:audit:orderids:md5:";

    /**
     * 基础模块
     */
    public static final String WKBB_BASIC = "wkbb:basic:";

    /**
     * 用户体系(前端)
     */
    public static final String WKBB_BASIC_USER_FRONT = "wkbb:basic:user:front:";

    /**
     * 用户体系(后端)
     */
    public static final String WKBB_BASIC_USER_BACK = "wkbb:basic:user:back:";

    /**
     * 用户体系(路由方式)
     */
    public static final String WKBB_BASIC_USER_ROUTE = "wkbb:basic:user:route:";

    public static final String WKBB_USER_TEACHER_ROUTE = "wkbb:user:teacher:route:";

    /**
     * 图片md5值缓存
     */
    public static final String WKBB_BASIC_IMAGE_MD5 = "wkbb:basic:imagemd5:url:";

    /**
     * 系统新增数据防重
     */
    public static final String WKBB_SYSTEM ="wkbb:basic:user:back:system:";

    public static final String WKBB_WX = "wkbb:wx:";

    /**
     * 微信第三方平台
     */
    public static final String WKBB_WX_THIRD = "wkbb:wx:third:";

    /**
     * 微信网页授权
     */
    public static final String WKBB_WX_AUTH = "wkbb:wx:auth:";

    /**
     * 考勤模块
     */
    public static final String WKBB_ATTEND = "wkbb:attend:";

    /**
     * 门禁模块
     */
    public static final String WKBB_DOOR = "wkbb:door:";

    /**
     * 门禁模块(消息推送)
     */
    public static final String WKBB_DOOR_MSG = "wkbb:door:msg";

    /**
     * 晨检模块
     */
    public static final String WKBB_MC_DEVICE = "wkbb:mc:device:";

    /**
     * 智慧校园模块
     */
    public static final String WKBB_SMART = "wkbb:smart:";

    /**
     * 体育模块
     */
    public static final String SPORTS = "sports:";

    /**
     * 用户信息(前端)
     */
    public static final String WKBB_BASIC_USER_FRONT_UNIONID = "user_unionid_";//老版本
    public static final String WKBB_BASIC_USER_FRONT_ACCOUNT_UNIONID = "user_accountid_%s_unionid_%s";//支持跨集团
    public static final String WKBB_BASIC_USER_FRONT_TOKEN_ACCOUNT = "account:user_unionid_%s";
    public static final String WKBB_BASIC_USER_ROUTE_TOKEN_UNIONID = "user_unionid_%s";
    public static final String WKBB_BASIC_STU_ROUTE_TOKEN_UNIONID = "stu_unionid_%s";

    /**
     * 用户信息(后端)
     */
    public static final String WKBB_BASIC_USER_BACK_TOKEN = "user_token_";

    /**
     * 验证码短信
     */
    public static final String WKBB_TC_SMS_VERIFY = "wkbb:tc:sms:verify:";

    /**
     * 组织RedisKey
     */
    public static String ORGANIZATION = RedisKeyConstant.WKBB_BASIC + "organization:";

    /**
     * 班级RedisKey
     */
    public static String CLASSINFO = RedisKeyConstant.WKBB_BASIC + "classinfo:";

    /**
     * 年级RedisKey
     */
    public static String GRADE = RedisKeyConstant.WKBB_BASIC + "grade:";

    /**
     * 菜单RedisKey
     */
    public static String MENU = RedisKeyConstant.WKBB_BASIC + "menu:";

    /**
     * 基础服务-字典数据
     */
    public static final String WKBB_BASIC_DICT = "wkbb:basic:dict:";

    /**
     * 教育社区-AI相关
     */
    public static final String WKBB_EDUCATION_COMMUNITY_AI = "wkbb:community:ai:";

    /**
     * 教育社区-视频相关
     */
    public static final String WKBB_EDUCATION_COMMUNITY_VIDEO = "wkbb:community:video:";

    /**
     * 考勤推送
     */
    public static final String WKBB_ATTEND_MES_SEND_FLAG = RedisKeyConstant.WKBB_ATTEND + "msg:send:flag:";

    /**
     * 考勤节假日
     */
    public static final String WKBB_BASIC_HOLIDAY = RedisKeyConstant.WKBB_BASIC + "holidays:";

    /**
     * 基础服务-配置数据
     */
    public static final String WKBB_BASIC_CONFIG = "wkbb:basic:config:";

    /**
     * 设备相关信息
     */
    public static final String WKBB_BASIC_DEVICE_INFO = "wkbb:basic:device:info:";

    /**
     * 设备相关-设备通行协议
     */
    public static final String WKBB_BASIC_DEVICE_PROTOCAL = "wkbb:basic:device:protocol:";

    /**
     * 设备相关-盒子信息
     */
    public static final String WKBB_BASIC_DEVICE_BOX = "wkbb:basic:device:box:";

    /**
     * 设备相关-IPC信息
     */
    public static final String WKBB_BASIC_DEVICE_IPC = "wkbb:basic:device:ipc:";

    /**
     * 巨龙相关-心跳
     */
    public static final String WKBB_BASIC_JVT_HEARTBEAT = "wkbb:basic:jvt:heartbeat:";

    /**
     * 巨龙相关-任务
     */
    public static final String WKBB_BASIC_JVT_TASK = "wkbb:basic:jvt:task:";
    /**
     * 巨龙相关-任务 的所有key放到一个集合里，这里定义这个集合的key
     */
    public static final String WKBB_BASIC_JVT_TASK_KEYS = "wkbb:basic:jvt:taskkeys:";
    /**
     * 巨龙相关-状态
     */
    public static final String WKBB_BASIC_JVT_STATUS = "wkbb:basic:jvt:status:";

    /**
     * 微众-ACCESS_TOKEN
     */
    public static final String WKBB_BASIC_WEBANK_ACCESS_TOKEN = "wkbb:basic:webank:accesstoken:webankAppid:";

    /**
     * 微众-SIGN_TICKET
     */
    public static final String WKBB_BASIC_WEBANK_SIGN_TICKET = "wkbb:basic:webank:signticket:webankAppid:";

    /**
     * 微众-DEVICE-INFO
     */
    public static final String WKBB_BASIC_WEBANK_DEVICE_INFO = "wkbb:basic:webank:deviceInfo:";


    /**
     * h5版本
     */
    public static final String WKBB_BASIC_COMMON_H5_VERSION = "wkbb:basic:common:h5:version";

    /**
     * 短链接
     */
    public static final String WKBB_BASIC_COMMON_DWZ = "wkbb:basic:common:dwz:";

    /**
     * 初始化考勤数据
     */
    public static final String WKBB_ATTEND_INIT_FLAG = RedisKeyConstant.WKBB_ATTEND + "init:flag:";

    /**
     * 初始化考勤数据
     */
    public static final String WKBB_ATTEND_ORG_HOLIDAY = RedisKeyConstant.WKBB_ATTEND + "holiday:info:";


    /**
     * 考勤抓拍开关（10秒钟内不能重复添加抓怕信息）
     */
    public static final String WKBB_ATTEND_SNAP_FLAG = RedisKeyConstant.WKBB_ATTEND + "snap:flag:";

    /**
     * 区域信息
     */
    public static final String WKBB_DOOR_AREA = RedisKeyConstant.WKBB_DOOR + "area:info:";

    /**
     * 门禁抓拍开关（10秒钟内不能重复添加抓怕信息）
     */
    public static final String WKBB_DOOR_SNAP_FLAG = RedisKeyConstant.WKBB_DOOR + "snap:flag:";

    /**
     * 门禁区域设备关联信息
     */
    public static final String WKBB_DOOR_AREA_DEVICE = RedisKeyConstant.WKBB_DOOR + "area:device:";

    /**
     * 校门考勤规则
     */
    public static final String WKBB_DOOR_GATE_USER_TEMPLATE = RedisKeyConstant.WKBB_DOOR + "gate:org_id_%s_role_id_%s_user_id_%s_template_id_%s";

    /**
     * 校门考勤规则模糊查询
     */
    public static final String WKBB_DOOR_GATE_LIKE_TEMPLATE = RedisKeyConstant.WKBB_DOOR + "gate:org_id_%s_*_template_id_%s";

    /**
     * 校门考勤规则
     */
    public static final String WKBB_DOOR_GATE_USER_LIKE_TEMPLATE = RedisKeyConstant.WKBB_DOOR + "gate:org_id_%s_*_user_id_%s_*";

    /**
     * 宿舍考勤规则
     */
    public static final String WKBB_DOOR_DORMITORY_USER_TEMPLATE = RedisKeyConstant.WKBB_DOOR + "dormitory:org_id_%s_role_id_%s_user_id_%s_template_id_%s";

    /**
     * 宿舍考勤规则信息
     */
    public static final String WKBB_DOOR_TEMPLATE = RedisKeyConstant.WKBB_DOOR + "template:template_id_%s";

    /**
     * 宿舍考勤模板模糊查询
     */
    public static final String WKBB_DOOR_DORMITORY_LIKE_TEMPLATE = RedisKeyConstant.WKBB_DOOR + "dormitory:template:org_id_%s_*_template_id_%s";

    /**
     * 宿舍用户考勤模板模糊查询
     */
    public static final String WKBB_DOOR_DORMITORY_USER_LIKE_TEMPLATE = RedisKeyConstant.WKBB_DOOR + "dormitory:template:org_id_%s_*_user_id_%s_*";

    /**
     * 家校通IM未读消息
     */
    public static final String WKBB_EDUCATION_COMMUNITY_IM_UNREAD_MSG = RedisKeyConstant.WKBB_EDUCATION_COMMUNITY_IM + "msg:unread:";

    /**
     *  智慧校园
     */
    public static final String WKBB_SMART_ORGANIZATION_INFO = RedisKeyConstant.WKBB_SMART + "org:";

    /**
     *  批量导入结果
     */
    public static final String WKBB_BASIC_IMPORT_RESULT = RedisKeyConstant.WKBB_BASIC + "import:";

    /**
     * 缓存时长，5年时间
     */
    public static final long EXPIRATION_TIME_OVER = 15552000L;

    /**
     * 缓存时长，1年时间
     */
    public static final long EXPIRATION_TIME_1_YEAR = 31536000L;

    /**
     * 缓存时长，半年时间
     */
    public static final long EXPIRATION_TIME_HALF_YEAR = 15768000;

    /**
     * 缓存时长，1月
     */
    public static final long EXPIRATION_TIME_1_MONTH = 2592000L;

    /**
     * 缓存时长，10天
     */
    public static final long EXPIRATION_TIME_10_DAY = 864000L;

    /**
     * 缓存时长，1周
     */
    public static final long EXPIRATION_TIME_1_WEEK = 604800L;

    /**
     * 缓存时长，1天
     */
    public static final long EXPIRATION_TIME_24_HOUR = 86400;

    /**
     * 缓存时长，2小时
     */
    public static final long EXPIRATION_TIME_2_HOUR = 7200;

    /**
     * 缓存时长，1小时
     */
    public static final long EXPIRATION_TIME_1_HOUR = 3600;

    /**
     * 缓存时长，50分钟
     */
    public static final long EXPIRATION_TIME_50 = 3000;
    /**
     * 缓存时长，40分钟
     */
    public static final long EXPIRATION_TIME_40 = 2400;
    /**
     * 缓存时长，30分钟
     */
    public static final long EXPIRATION_TIME_30 = 1800;
    /**
     * 缓存时长，20分钟
     */
    public static final long EXPIRATION_TIME_20 = 1200;

    /**
     * 缓存时长，10分钟
     */
    public static final long EXPIRATION_TIME_10 = 600;

    /**
     * 缓存时长，5分钟
     */
    public static final long EXPIRATION_TIME_5 = 300;

    /**
     * 缓存时长，1分钟
     */
    public static final long EXPIRATION_TIME_1 = 60;

    /**
     * 缓存时长，30秒
     */
    public static final long EXPIRATION_SECOND_30 = 30;

    /**
     * 缓存时长，20秒
     */
    public static final long EXPIRATION_SECOND_20 = 20;

    /**
     * 缓存时长，10秒
     */
    public static final long EXPIRATION_SECOND_10 = 10;

    /**
     * 缓存时长，10秒
     */
    public static final long EXPIRATION_SECOND_1 = 1;

}
